#include "Plane.h"


Plane::Plane(Vector3* position, Vector3* scale, Vector3* color) : DrawablePrimitive(position, scale)
{
	this->verticies = new Vector3*[4];
	this->verticies[0] = new Vector3(1, 0, 1);
	this->verticies[1] = new Vector3(1, 0, -1); 
	this->verticies[2] = new Vector3(-1, 0, 1);
	this->verticies[3] = new Vector3(-1, 0, -1);

	this->faceColors = new Vector3*[1];
	this->faceColors[0] = color;
}


Plane::~Plane(void)
{
}

void Plane::Draw()
{
		glBegin(GL_QUADS);

			glColor3f(this->faceColors[0]->x, this->faceColors[0]->y, this->faceColors[0]->z);

			glVertex3f(this->verticies[0]->x, this->verticies[0]->y, this->verticies[0]->z);
			glVertex3f(this->verticies[1]->x, this->verticies[1]->y, this->verticies[1]->z);
			glVertex3f(this->verticies[3]->x, this->verticies[3]->y, this->verticies[3]->z);
			glVertex3f(this->verticies[2]->x, this->verticies[2]->y, this->verticies[2]->z);

		glEnd();
}